<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\User as AuthModel;

class User extends AuthModel
{
    use HasFactory;
    protected $deleteTime = 'deleted_at';




    public function role()
    {
        //一对一的关系
        //第一个参数关联表模型
        //第二个参数 关联模型的主键
        //第三个参数 本模型的外键
        return $this->hasOne(Role::class,'id','role_id');
    }
}
